import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:"/home",
    children:[
      {
        path:'teacher',
        name:'teacher',
        component:()=>import('@/views/teacher/index.vue')
      },
      {
        path:'id/:id',
        name:'id',
        component:()=>import('@/views/teacher/id.vue')
      },
      {
        name:'order',
        path:'order/:id',
        component:()=>import('@/views/order/id.vue')
      },
      {
        path:'course',
        name:'course',
        component:()=>import('@/views/course/index.vue')
      },
      {
        path:'course/:id',
        name:'courseInfo',
        component:()=>import('@/views/course/id.vue')
      },
      {
        path:'play',
        name:'play',
        component:()=>import('@/views/player/id.vue')
      },
      {
        path:'home',
        name:'childrenhome',
        component:()=>import('@/views/home/index.vue')
      }
    ]
  },
  {
    name:'register',
    path:'/register',
    component:()=>import('@/views/register/Register.vue')
  },
  {
    name:'login',
    path:'/login',
    component:()=>import('@/views/login/Login.vue')
  }
 
]

const router = new VueRouter({
  routes
})

export default router
